<!-- brandnew 页面内容 -->
<section class="brandnew" ng-controller="brandnewCtrl">
  <ol class="breadcrumb">
      <li ui-sref="mine.list({ ctrl: 'enterprise' })"><a>品牌管理</a></li>
      <li><a>品牌添加</a></li>
  </ol>
  <div class="panel panel-default">
    <div class="panel-body">
      <form name="brandnewForm" novalidate>
      	<div ng-show="step == 1">
      		<div class="form-group send-code-input">
			    <label for="brandname">手机号</label>
			    <a type="button" href="javascript:void(0);" class="btn btn-default send-code-btn pull-right" ng-click="sendCode(brandnew.old_tel);" ng-disabled="isDisplayTime" ng-bind="isDisplayTime ? count_down_time + '秒后发送': '发送验证码'"></a>
			    <input type="text" class="form-control" ng-model="brandnew.old_tel" name='old_tel' disabled ng-pattern="/^1\d{10}$/" placeholder="请输入手机号" required>
			    <div class="form-group error-container" ng-show="newbrandfirst && (brandnewForm.old_tel.$error.pattern || brandnewForm.old_tel.$error.required)">
	                请输入正确手机号！
	            </div>
			</div>
			<div class="form-group">
			    <label for="brandname">验证码</label>
			    <input type="text" class="form-control" ng-model="brandnew.old_code" name='old_code' ng-pattern="/\d{6}/i" placeholder="请输入验证码" required>
			    <div class="form-group error-container" ng-show="newbrandfirst && (brandnewForm.old_code.$error.pattern || brandnewForm.old_code.$error.required)">
	                请输入6位验证码！
	            </div>
			</div>
			<div class="form-group">
			    <button type="submit" class="btn btn-mt-ok" ng-click="nextStep(brandnew.old_tel, brandnew.old_code);">下一步</button>
			</div>
      	</div>
      	<div ng-show="step == 2">
      		<div class="form-group">
			    <label for="brandname">品牌名称</label>
			    <input type="text" class="form-control" ng-model="brandnew.name" name='name' id="brandname" placeholder="请输入品牌名称" required>
			    <div class="form-group error-container" ng-show="newbrandfirst &&  brandnewForm.name.$error.required">
	                请输入品牌名称！
	            </div>
			</div>
			<div class="form-group">
			    <label for="brandname">品牌LOGO</label>
			    <input type="file" class="form-control" style="display: none;" id="brandnewimages" placeholder="请输入品牌名称">
			    <img src="./components/mine/orders/orderdetail/imgs/add.png" id='previewImages' style="width: 40px;height:40px;cursor: pointer;display: block;" onclick='document.getElementById("brandnewimages").click()'>
			   	<div class="form-group error-container" ng-show="newbrandfirst && brandnewimages">
	                请输入品牌名称！
	            </div>
			</div>
			<div class="form-group">
			    <label for="brandname">管理员名称</label>
			    <input type="text" class="form-control" ng-model="brandnew.real_name" name='real_name' placeholder="请输入管理员名称" required>
			    <div class="form-group error-container" ng-show="newbrandfirst && brandnewForm.real_name.$error.required">
	                请输入品牌名称！
	            </div>
			</div>
			<div class="form-group send-code-input">
			    <label for="brandname">手机号</label>
			    <a type="button" href="javascript:void(0);" class="btn btn-default send-code-btn pull-right" ng-click="sendCode(brandnew.tel);" ng-disabled="isDisplayTime" ng-bind="isDisplayTime ? count_down_time + '秒后发送': '发送验证码'"></a>
			    <input type="text" class="form-control" ng-model="brandnew.tel" name='tel' ng-pattern="/^1\d{10}$/" placeholder="请输入手机号" required>
			    <div class="form-group error-container" ng-show="newbrandfirst && (brandnewForm.tel.$error.pattern || brandnewForm.tel.$error.required)">
	                请输入正确手机号！
	            </div>
			</div>
			<div class="form-group">
			    <label for="brandname">验证码</label>
			    <input type="text" class="form-control" ng-model="brandnew.code" name='code' ng-pattern="/\d{6}/i" placeholder="请输入验证码" required>
			    <div class="form-group error-container" ng-show="newbrandfirst && (brandnewForm.code.$error.pattern || brandnewForm.code.$error.required)">
	                请输入6位验证码！
	            </div>
			</div>
			<div class="form-group">
			    <label for="brandname">密码</label>
			    <input type="password" class="form-control" ng-model="brandnew.password" name="password" ng-pattern="/^\S{6,20}$/" placeholder="请输入密码" required>
			    <div class="form-group error-container" ng-show="newbrandfirst &&  (brandnewForm.password.$error.pattern || brandnewForm.password.$error.required)">
	                请输入最少6位的密码！
	            </div>
			</div>
			<div class="form-group">
			    <button type="submit" class="btn btn-mt-ok" ng-click="addBrand(brandnewForm.$invalid, brandnew);">保存</button>
			</div>
      	</div>
      </form>
    </div>
  </div>
      
</section>